import React, {useEffect, useState} from "react";
import DetailListView from "../DetailListView";
import api from "../../../api"
const DetailList=(props)=>{
    const [detailData,setdetailData]=useState({})

    useEffect(()=>{
        api.details({
            id:props.id
        }).then(res=>{
            if (res.status === 200){
                // console.log("List中的数据判断是否拿到"+res.status+props.id)
                // console.log(res.data)
                console.log("判断是否拿到数据")

                setdetailData(res.data)
                console.log(detailData)

            }
        })
    },[])



    return (
        <div>
            {
                 detailData.imgs?
                    <DetailListView detailData={detailData} id={props.id}/>:
                  <div>详情数据正在补充中.....</div>
        }


        </div>
    )
}

export default DetailList